from sqlalchemy import Column, Integer, String, Boolean, DateTime, Float
from sqlalchemy.sql import func
from app.core.database import Base

class UserConfig(Base):
    """用户配置模型"""
    __tablename__ = "user_configs"

    id = Column(Integer, primary_key=True, index=True)
    api_key = Column(String, nullable=True)
    theme = Column(String, default="light")
    language = Column(String, default="zh")
    max_tokens = Column(Integer, default=1000)
    temperature = Column(Float, default=0.7)
    created_at = Column(DateTime(timezone=True), server_default=func.now())
    updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())

    class Config:
        orm_mode = True 